import {getToken} from '@/utils'
const initialState = getToken() || ''
export const login = (state = initialState, action) => {
  if (action.type === 'login/token') {
    return action.payload
  }
  if (action.type === 'login/out') {
    return ''
  }
  return state
}